/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.nuage.tiow.ui;

import com.vaadin.data.util.ObjectProperty;
import com.vaadin.data.util.PropertysetItem;
import org.nuage.tiow.vo.warhost.Unit;

/**
 *
 * @author quentina
 */
public final class UnitItem extends PropertysetItem {

    private Unit unit;

    public UnitItem(Unit unit) {
        this.unit = unit;
        addItemProperty("name", new ObjectProperty(unit.getName()));
        addItemProperty("type", new ObjectProperty(unit.getType()));
        addItemProperty("description", new ObjectProperty(unit.getDescription()));
        addItemProperty("namedCharacter", new ObjectProperty(unit.isNamedCharacter()));
        addItemProperty("independentCharacter", new ObjectProperty(unit.isIndependentCharacter()));
        addItemProperty("points", new ObjectProperty(unit.getPoints()));
    }

    public Unit getUnit() {
        return unit;
    }
}
